home *** CD-ROM | disk | FTP | other *** search
- #include <exec/types.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include "dh1:source/doors/romconf/doorheader.h"
- #define PRV_COMMAND 508
- #define PRV_GROUP 509
- #define BB_CONFNUM 510
- #define pu putuserstring
- #define gu getuserstring
- #define sm sendmessage
- #define pm prompt
- void end(void);
- void sr(char *str);
-
- char command[255];
- int Group;
- char Config[200];
- char Confs[200];
- main(int argc,char *argv[])
- {
- FILE *fi;
- int secure=0;
- if(argc!=2)
- {
- printf("Groups, version 1.0, written by Joseph Hodge\n");
- printf("This is a (XIM) for AmiExpress 2.08+\n");
- printf("\n");
- exit(0);
- }
- Register(argv[1][0]-'0');
- gu(Config,DT_SECSTATUS);
- Group=atoi(Config);
- fi=fopen("DOORS:Group/Group.cfg","r");
- if(fi==NULL)
- {
- ShutDown();
- end();
- }
-
- while(fgets(Confs,90,fi)!=NULL)
- {
- if(secure && Confs[0]==']') break;
- if(Confs[0]=='[' || Confs[0]==']') continue;
- sr(Confs);
- if(atoi(&Confs[1])<=Group)
- {
- secure=1;
- strcpy(Config,&Confs[6]);
- Config[0]=Config[0]-1;
- pu(Config,PRV_GROUP);
- }
- }
- fclose(fi);
- ShutDown();
- end();
- }
-
- void end(void)
- {
- exit(0);
- }
-
- void sr(char *str)
- {
- register int i;
- i=strlen(str)-1;
- while(i>-1)
- {
- if(*(str+i)<=32) *(str+i)='\0'; else break;
- i--;
- }
- }